package com.hexb.smh.controller.management;

import com.hexb.core.utils.Assert;
import com.hexb.smh.annotations.AopOperationLog;
import com.hexb.smh.entity.Brand;
import com.hexb.smh.entity.Commission;
import com.hexb.smh.entity.param.commission.CommissionParam;
import com.hexb.smh.entity.view.CommissionTable;
import com.hexb.smh.errors.ErrorCodes;
import com.hexb.smh.mapper.BrandMapper;
import com.hexb.smh.service.ICommissionService;
import com.hexb.smh.utils.AccountHelper;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.NonNull;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.apache.shiro.authz.annotation.Logical;
import org.apache.shiro.authz.annotation.RequiresRoles;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;

import javax.servlet.ServletOutputStream;
import javax.servlet.http.HttpServletResponse;
import javax.validation.Valid;
import java.io.IOException;
import java.net.URLEncoder;
import java.util.List;

import static com.hexb.smh.utils.SmhConstant.ROLE_ADMIN;
import static com.hexb.smh.utils.SmhConstant.ROLE_SUPER_ADMIN;

/**
 * @author : hexb
 */
@RestController
@RequestMapping("/management/brand")
@RequiredArgsConstructor(onConstructor = @__(@Autowired))
@Api(value = "A10*.品牌", description = "Server", tags = {"A10*.品牌"})
@Slf4j
public class BrandController {

    @NonNull
    final private BrandMapper brandMapper;

    @RequiresRoles(value = {ROLE_SUPER_ADMIN, ROLE_ADMIN}, logical = Logical.OR)
    @ApiOperation("获取品牌列表")
    @GetMapping("/list")
    public List<Brand> list() {
        return brandMapper.list();
    }

}
